package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.TbCpadEmployeeMapper;
import com.ruoyi.business.domain.TbCpadEmployee;
import com.ruoyi.business.service.ITbCpadEmployeeService;

/**
 * 员工信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-17
 */
@Service
public class TbCpadEmployeeServiceImpl implements ITbCpadEmployeeService 
{
    @Autowired
    private TbCpadEmployeeMapper tbCpadEmployeeMapper;

    /**
     * 查询员工信息
     * 
     * @param id 员工信息主键
     * @return 员工信息
     */
    @Override
    public TbCpadEmployee selectTbCpadEmployeeById(Long id)
    {
        return tbCpadEmployeeMapper.selectTbCpadEmployeeById(id);
    }

    /**
     * 查询员工信息列表
     * 
     * @param tbCpadEmployee 员工信息
     * @return 员工信息
     */
    @Override
    public List<TbCpadEmployee> selectTbCpadEmployeeList(TbCpadEmployee tbCpadEmployee)
    {
        return tbCpadEmployeeMapper.selectTbCpadEmployeeList(tbCpadEmployee);
    }

    /**
     * 新增员工信息
     * 
     * @param tbCpadEmployee 员工信息
     * @return 结果
     */
    @Override
    public int insertTbCpadEmployee(TbCpadEmployee tbCpadEmployee)
    {
        tbCpadEmployee.setCreateTime(DateUtils.getNowDate());
        return tbCpadEmployeeMapper.insertTbCpadEmployee(tbCpadEmployee);
    }

    /**
     * 修改员工信息
     * 
     * @param tbCpadEmployee 员工信息
     * @return 结果
     */
    @Override
    public int updateTbCpadEmployee(TbCpadEmployee tbCpadEmployee)
    {
        tbCpadEmployee.setUpdateTime(DateUtils.getNowDate());
        return tbCpadEmployeeMapper.updateTbCpadEmployee(tbCpadEmployee);
    }

    /**
     * 批量删除员工信息
     * 
     * @param ids 需要删除的员工信息主键
     * @return 结果
     */
    @Override
    public int deleteTbCpadEmployeeByIds(Long[] ids)
    {
        return tbCpadEmployeeMapper.deleteTbCpadEmployeeByIds(ids);
    }

    /**
     * 删除员工信息信息
     * 
     * @param id 员工信息主键
     * @return 结果
     */
    @Override
    public int deleteTbCpadEmployeeById(Long id)
    {
        return tbCpadEmployeeMapper.deleteTbCpadEmployeeById(id);
    }
}
